function createTime(ctimeMs){
    var date = new Date(ctimeMs);
    console.log(date.toLocaleString());//2021/9/15上午8:23:20
    console.log(date.toLocaleDateString());//2021/9/15
    console.log(date.toLocaleTimeString());//上午8:23:20
    console.log(date.getTime());
}

const fs = require("fs");
const path = require("path");

var filePath = path.join(__dirname,"./1.txt");

var fileObj = fs.statSync(filePath);//获取文件相关属性
var ctimeMs = fileObj.ctimeMs;//创建时间

createTime(ctimeMs);
// var data_1 = new Date(ctimeMs);
// console.log(data_1);
// console.log(data_1.getFullYear());